<#macro page table formId contentId action="" success="">
<script>
    function submitForm${formId}${contentId}(pageSize, currentPage) {
        var searchForm = $('#' + '${formId}');
        searchForm.find("input[name=pageSize]").val(pageSize);
        searchForm.find("input[name=currentPage]").val(currentPage);
        <#if action != ''>
            $(searchForm).attr("action", '${action}');
        </#if>

        searchForm.ajaxSubmit({
           success:function(data) {
               var data = JSON.parse(data);
               if (data.returnCode == 1) {
                   $('#' + '${contentId}').html(data.content.data);
                   <#if success != ''>
                       ${success}();
                   </#if>
               } else {
                   $.showMessage({parentId:"errorMessage",message:"表格数据加载异常！",type:"success"});
               }
           }
        });
    }
</script>
<div class="col-sm-12 text-right">
    <ul class="pagination pagination-sm nomargin pagination-custom">
        <#if table.page.currentPage == 1>
            <li><a href="javascript:;"><span class="disabled"><i class="fa fa-angle-double-left"></i></span></a>
            </li>
            <li><a href="javascript:;"><span class="disabled"><i class="fa fa-angle-left"></i></span></a>
            </li>
        <#else>
            <li onclick="submitForm${formId}${contentId}(${table.page.pageSize?c}, 1);"><a href="javascript:;"><span
                    class="pagepre"><i class="fa fa-angle-double-left"></i></span></a></li>
            <li onclick="submitForm${formId}${contentId}(${table.page.pageSize?c}, ${table.page.currentPage - 1});"><a href="javascript:;"><span
                    class="pagepre"><i class="fa fa-angle-left"></i></span></a></li>
        </#if>
        <li><a href="javascript:;"><span>${table.page.currentPage}/${table.page.totalPage}</span></a></li>
        <#if table.page.currentPage == table.page.totalPage || table.page.totalPage == 0>
            <li><a href="javascript:;"><span><i class="fa fa-angle-right"></i></span></a></li>
        <#else>
            <li
                onclick="submitForm${formId}${contentId}(${table.page.pageSize?c}, ${table.page.currentPage + 1});"><a
                    href="javascript:;"><span><i class="fa fa-angle-right"></i></span></a></li>
            <li
                    onclick="submitForm${formId}${contentId}(${table.page.pageSize?c}, ${table.page.totalPage?c});"><a
                    href="javascript:;"><span><i class="fa fa-angle-double-right"></i></span></a></li>
        </#if>
    </ul>
</div>
</#macro>
